package so.sao.code.service.infrastructure.enums.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.service.infrastructure.enums.TagRangeStatus;

/**
 * Created by Administrator on 2017/7/12.
 */
@Converter(autoApply = true)
public class TagRangeStatusConvert implements AttributeConverter<TagRangeStatus, Integer> {
	@Override
	public Integer convertToDatabaseColumn(TagRangeStatus attribute) {
		return attribute.getValue();
	}

	@Override
	public TagRangeStatus convertToEntityAttribute(Integer dbData) {
		return TagRangeStatus.fromValue(dbData);
	}
}
